home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-17 | 3.8 KB | 130 lines | [TEXT/ttxt] |
- -- <<<
- -- file wdgtest.sx
- open LibraryContainer path:"widgets.sxl"
- Module test
- uses ScriptX, WidgetInterface
- end
- in module test
- global w := new Window
- w.fill := new Brush pattern:(importDIB "media/bkgnd.bmp")
- show w
- global ac := new ActuatorController space:w wholeSpace:true
-
- -- StencilButton
- global bitmapButton := new StencilButton \
- stencil:(importDIB "media/kicon.bmp")
- bitmapButton.position := new Point x:35 y:14
- global sbCaption := new Label text:"StencilButton"
- sbCaption.position := new Point x:10 y:60
- append w sbCaption
- append w bitmapButton
-
- -- TextButton
- global textB := new TextButton text:"Kaleida!"
- textB.position := new Point x:120 y:30
- global tbCaption := new Label text:"TextButton"
- tbCaption.position := new Point x:120 y:60
- append w tbCaption
- append w textB
-
- -- ScrollListBox
- global wdgclass_list := #("ColorScheme", "FontContext", "Frame", \
- "Label", "GenericButton", "RadioButton", "CheckBox", \
- "StencilButton", "TextButton", "PopUpButton", "RadioGroup", \
- "ListBox", "SmallTextEdit", "ListSelection", \
- "SimpleScrollBar", "ScrollingTextEdit", "ScrollBox", \
- "MultiListBox", "ScrollListBox", "PopUpMenu")
-
- global slb := new ScrollListBox list:wdgclass_list \
- boundary:(new Rect x2:135 y2:210) \
- hasScrollBar:true
- slb.x := 10
- slb.y := 150
- global slbCaption := new Label text:"ScrollListBox"
- slbCaption.position := new Point x:10 y:120
- append w slbCaption
- append w slb
-
- -- CheckBox
- global cb := new CheckBox text:"Check Me" frame:(new Frame)
- cb.x := 170; cb.y := 130
- global cbCaption := new Label text:"CheckBox"
- cbCaption.position := new Point x:170 y:100
- append w cbCaption
- append w cb
-
- -- Radio Button
- global rb := new RadioButton text:"On/Off" frame:(new Frame)
- rb.x := 170; rb.y := 210
- global rbCaption := new Label text:"RadioButton"
- rbCaption.position := new Point x:170 y:180
- append w rbCaption
- append w rb
-
- -- Radio Group
- global rg := new RadioGroup \
- itemList:#(@one:"One", @two:"Two", @three:"Three")
- rg.position := new Point x:170 y:290
- global rgCaption := new Label text:"RadioGroup"
- rgCaption.position := new Point x:170 y:260
- append w rgCaption
- append w rg
-
- -- SmallTextEdit
- global smallTE := new SmallTextEdit text:("120" as Text) \
- boundary:(new Rect x2:35 y2:20)
- smallTE.x := 230
- smallTE.y := 30
- global steCaption := new Label text:"SmallTextEdit"
- steCaption.position := new Point x:210 y:60
- append w steCaption
- append w smallTE
-
- -- PopUpMenu
- global puMenu := new PopUpMenu \
- list:#(@one:"one",@two:"two",@fewWords:"A Few Words") \
- width:104 actuatorController:undefined layoutController:undefined
- -- PopUpButton
- global popUpB := new PopUpButton menu:puMenu value:@two
- popUpB.x := 330
- popUpB.y := 50
- global pumCaption := new Label text:"PopUpMenu"
- pumCaption.position := new Point x:330 y:20
- append w pumCaption
- append w popUpB
-
- -- MultiListBox
- global mlb := new MultiListBox boundary:(new Rect x2:120 y2:120) \
- list:#(#(1,@one), #(2,@two), #(3,@three), #(4,@four), \
- #(5,@five),#(6,@six),#(7,@seven))
- mlb.x := 460
- mlb.y := 50
- global mlbCaption := new Label text:"MultiListBox"
- mlbCaption.position := new Point x:460 y:20
- append w mlbCaption
- append w mlb
-
- -- ScrollingTextEdit
- global TEstream := getStream theScriptDir "media/scrollte.txt" \
- @readable
- global TEtext := importMedia theImportExportEngine TEstream @Text \
- @ASCIItext @TextEdit
- global scrollTE := new ScrollingTextEdit \
- boundary:(new Rect x2:280 y2:160) \
- textWidth:260 textHeight:600 text:TEtext autoRecalc:false
- scrollTE.x := 300
- scrollTE.y := 200
- global scteCaption := new Label text:"ScrollingTextEdit"
- scteCaption.position := new Point x:300 y:170
- append w scteCaption
- append w scrollTE
- global txtPres := scrollTE.targetPresenter
-
- global tc := new TitleContainer dir:theScriptDir path:"wdgtest.sxt" \
- name:"Widget Kit Test"
- w.title := tc
- append tc (getModule @test)
- tc.startupAction := (tc -> for i in tc do load i; show w)
- close tc
- -- >>>
-